home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1995 January
/
1995-01b.d64
/
file un_lock
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
608b
|
15 lines
10 print"lock/unlock files" :
15 input"file name";n$:iflen(n$)<1orlen(n$)>16thenprint"wrong length":goto15
20 close15:open15,8,15:print#15,"i0:":close5:open5,8,5,"#":t=18:s=1
25 print#15,"u1:"5;0;t;s:print#15,"b-p:5,0":get#5,t$:get#5,s$
30 fori=2to255step32:j=0:x$="":print#15,"b-p:"5;i:print".";
35 get#5,y$:x=asc(y$+chr$(0)):get#5,y$:get#5,y$:ifx<128then65
40 get#5,y$:ify$<>chr$(160)andlen(x$)<16thenx$=x$+y$:goto40
45 ifn$<>x$then65
50 x=not(xand64)and(xor64):remflip lock
55 print#15,"b-p"5;i:print#5,chr$(x);:print#15,"u2:"5;0;t;s
60 print:print"file now "mid$("un",(xand64)+1,2)"locked":i=999:next:goto75
65 next:t=asc(t$+chr$(0)):s=asc(s$+chr$(0)):ift<>0then25
70 print" no match found [146]"
75 input#15,er,er$:print"disk status"er;er$:print#15,"i0:":close15:end